package cn.like.backEnd.config;

import cn.dev33.satoken.dao.SaTokenDaoRedisJackson;
import cn.like.common.config.BaseConfig;
import cn.like.feign.AuthUserFeignService;
import cn.like.satoken.core.PermissionAndRoleInformation;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * desc: 认证服务 基本配置 <br>
 * details:
 *
 * @author like 980650920@qq.com
 * @date 2021-07-08 10:15:02
 * @see BaseConfig
 */
@Configuration
public class AdminWebConfiguration extends BaseConfig {

     // Inject
    public final SaTokenDaoRedisJackson saTokenDaoRedisJackson;
    public final AuthUserFeignService authUserFeignService;

    public AdminWebConfiguration(SaTokenDaoRedisJackson saTokenDaoRedisJackson, AuthUserFeignService authUserFeignService) {
        this.saTokenDaoRedisJackson = saTokenDaoRedisJackson;
        this.authUserFeignService = authUserFeignService;
    }

    @Bean
    public PermissionAndRoleInformation permissionAndRoleInformation(){
        return new PermissionAndRoleInformation(saTokenDaoRedisJackson,authUserFeignService);
    }
}